import { WebView } from "@tarojs/components";
import Taro from "@tarojs/taro";
import { useEffect, useState } from "react";



const WebviewPage: React.FC = () =>{
    const [pageUrl,serPageUrl] = useState('') 
    const handlePageOnload=(e)=>{
        // console.log('onload',e.detail.url)
        // serPageUrl(e.detail.url)
    }
    useEffect(()=>{
        const url = decodeURIComponent(Taro.getCurrentInstance()?.router?.params?.url || '')
        serPageUrl(url)
    },[])
    return (
        <WebView src={pageUrl}  onLoad={handlePageOnload}/>
      )
}

export default WebviewPage;